<div class="panel-heading"><span class="titulo_modulo">Nuevo</span></div>
<?php echo $this->Form->create('Usuario', array('id' => 'usuario', 'inputDefaults' => array('div' => false, 'label' => false))); ?>
<table class="form_registros">
    <tr>
        <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
        <td>C&eacute;dula</td>
        <td><?php echo $this->Form->input('cedula', array('class' => 'cedrif')); ?></td>
    </tr>
    <tr>
        <td>Nombres</td>
        <td><?php echo $this->Form->input('nombre'); ?></td>
    </tr>
    <tr>
        <td>Apellidos</td>
        <td><?php echo $this->Form->input('apellido'); ?></td>
    </tr>
    <tr>
        <td>Direcci&oacute;n</td>
        <td><?php echo $this->Form->input('direccion', array('type' => 'text')); ?></td>
    </tr>
    <tr>
        <td>Tel&eacute;fono</td>
        <td><?php echo $this->Form->input('telefono', array('class' => 'telf')); ?></td>
    </tr>
    <tr>
        <td>Correo</td>
        <td><?php echo $this->Form->input('Usuario.correo', array('type' => 'text')); ?></td>
    </tr>
    <tr>
        <td>Usuario</td>
        <td><?php echo $this->Form->input('usuario'); ?></td>
    </tr>
    <tr>
        <td>Contrase&ntilde;a</td>
        <td><?php echo $this->Form->input('confirmar', array('type' => 'password', 'id' => 'confirmar', 'name' => 'confirmar')); ?></td>
    </tr>
    <tr>
        <td>Confirmar Contrase&ntilde;a</td>
        <td><?php echo $this->Form->input('contrasena', array('type' => 'password')); ?></td>
    </tr>
    <tr>
        <td>Perfil</td>
        <td><?php echo $this->Form->select('UsuarioPerfil.perfil_id', $listadoPerfiles, array('empty' => 'Seleccione')); ?></td>
    </tr>
    <tr>
        <td colspan="2">&nbsp;</td>
    </tr>
        <td colspan="2" class="centro">
            <?php echo $this->Form->button('Guardar', array('class' => 'btn_accion guardar')); ?>&nbsp;
            <?php echo $this->Html->link('Cancelar', array('controller' => 'Usuarios', 'action' => 'index'), array('class' => 'btn_accion cancelar')) ?>
        </td>
    </tr>
</table>
<?php
    echo $this->Form->end();

    $this->Validador->setFormulario('usuario');
    $this->Validador->setRules('data.Usuario.cedula', array('required' => array('value' => true), 'remote' => array('url' => "'" . Router::url(array('controller' => 'Validacions', 'action' => "codigo/usuario")) . "'", 'async' => true, 'message' => 'Cédula/Rif Duplicado')));
    $this->Validador->setRules('data.Usuario.nombre', array('required' => array('value' => true)));
    $this->Validador->setRules('data.Usuario.direccion', array('required' => array('value' => true)));
    $this->Validador->setRules('data.Usuario.correo', array('required' => array('value' => true), 'email' => array('value' => true), 'remote' => array('url' => "'" . Router::url(array('controller' => 'Validacions', 'action' => "codigo/correo")) . "'", 'async' => true, 'message' => 'Correo Duplicado')));
    $this->Validador->setRules('data.Usuario.usuario', array('required' => array('value' => true), 'remote' => array('url' => "'" . Router::url(array('controller' => 'Validacions', 'action' => "codigo/usu_nom")) . "'", 'async' => true, 'message' => 'Usuario Duplicado')));
    $this->Validador->setRules('confirmar', array('required' => array('value' => true)));
    $this->Validador->setRules('data.Usuario.contrasena', array('required' => array('value' => true), 'equalTo' => array('value' => '"#confirmar"', 'message' => 'La contraseña no coincide')));
    $this->Validador->setRules('data.UsuarioPerfil.perfil_id', array('required' => array('value' => true)));
    $this->Validador->printScript(true);
?>
<script type="text/javascript">
    $(function(){
        $("form#usuario").tooltip({
            show: false,
            hide: false
        });
    });
</script>